

package jetbrains.buildServer.server.graphql.model.connections;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface PaginationArgumentsProvider {
  int DEFAULT_PAGE_SIZE = 100;

  @NotNull
  PaginationArguments get(@Nullable Integer first, @Nullable String after, @NotNull FallbackBehaviour fallbackBehaviour);

  @NotNull
  PaginationArguments get(@Nullable Integer first, @Nullable String after, @Nullable Integer last, @Nullable String before, @NotNull FallbackBehaviour fallbackBehaviour);

  @NotNull
  PaginationArguments getFirstPage();

  @NotNull
  PaginationArguments getLastPage();

  public enum FallbackBehaviour {
    RETURN_EVERYTHING,
    RETURN_FIRST_PAGE
  }
}